package com.iotp.service.msg_config;

import com.iotp.dao.msg_config.MsgConfigMapper;
import com.iotp.entity.msg_config.MsgConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("msgConfigService")
public class MsgConfigServiceImpl implements MsgConfigService {
    @Autowired
    private MsgConfigMapper msgConfigMapper;
    @Override
    public Long add(MsgConfig msgConfig) {
        this.msgConfigMapper.insert(msgConfig);
        return msgConfig.getId();
    }

    @Override
    public void update(MsgConfig msgConfig) {
        this.msgConfigMapper.updateByPrimaryKey(msgConfig);
    }

    @Override
    public void delete(Long id) {
        this.msgConfigMapper.deleteByPrimaryKey(id);
    }

    @Override
    public MsgConfig queryById(Long id) {
        return this.msgConfigMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<MsgConfig> queryByList(MsgConfig msgConfig) {
        return this.msgConfigMapper.selectByCondition(msgConfig);
    }
}
